package com.tuo51.childcare.repository;

import com.tuo51.childcare.domain.bize.BizEvaluateDimension;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;

@Repository
@CacheConfig(cacheNames = "BizEvaluateDimensionRepository")
public interface BizEvaluateDimensionRepository extends JpaRepository<BizEvaluateDimension,String> {

    @Modifying
    void deleteAllBySheetId(String sheetId);

    @Cacheable(keyGenerator = "keyGenerator")
    BizEvaluateDimension getBySheetIdAndName(String sheetId, String name);

    @Cacheable(keyGenerator = "keyGenerator")
    BizEvaluateDimension getBySheetIdAndId(String sheetId, String id);

}
